/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.simulation;
import java.awt.event.MouseListener;
import java.awt.event.MouseMotionListener;
import java.awt.event.MouseEvent;
import java.awt.Graphics;
/**
 *
 * @author 29159
 */
public class Mouse implements MouseListener,MouseMotionListener{
    int x1,x2,y1,y2;
    Graphics g;
    @Override
    public void mouseClicked(MouseEvent e) {
        
    }
    @Override
    public void mousePressed(MouseEvent e) {
        x1=e.getX();
        y1=e.getY();
    }
    @Override
    public void mouseReleased(MouseEvent e) {
        
    }
    @Override
    public void mouseEntered(MouseEvent e) {
        
    }
    @Override
    public void mouseExited(MouseEvent e) {
        
    }

    @Override
    public void mouseDragged(MouseEvent e) {
        x2=e.getX();
        y2=e.getY();
        Spring.setpos(Spring.pos+y2-y1);
        x1=x2;
        y1=y2;
    }

    @Override
    public void mouseMoved(MouseEvent e) {
        
    }
}
